<!doctype html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>确认订单</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/base.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/detail.css" />
</head>
<body>
<div class="detail">
    <div class="state">
        <switch name="order['state']">
            <case value="0">
                <!--待付款-->
                <div class="inner">
                    <h2 style="padding-top:0;">等待买家付款</h2>
                    <span><img src="__PUBLIC__/Wx/img/icon04.png"/></span>
                </div>
            </case>
            <case value="1">
                <!--待核销-->
                <div class="inner">
                    <h2 style="padding-top:0;">待核销</h2>
                    <span><img src="__PUBLIC__/Wx/img/icon21.png"/></span>
                </div>
            </case>
            <case value="2">
                <!--已核销-->
                <div class="inner">
                    <h2>已核销</h2>
                    <span><img src="__PUBLIC__/Wx/img/icon22.png"/></span>
                </div>
            </case>
            <case value="3">
                <!--已评价-->
                <div class="inner">
                    <h2>已评价</h2>
                    <span><img src="__PUBLIC__/Wx/img/icon08.png"/></span>
                </div>
            </case>
        </switch>
    </div>
    <div class="address">
        <div class="add" style="background:none;">
            <a href="javascript:0;">
                <h3><span>{$store.storename}</span><span>{$store.mobile}</span></h3>
                <p>取货地址：{$store.address}</p>
                <!--<b>{$store.storename}</b>-->
            </a>
        </div>
    </div>
    <div class="prolist">
        <!--<div class="pro" onClick="window.location='prodetail-pf.html'">
            <div class="pic"><img src="__PUBLIC__/Wx/images/pic13.jpg"/></div>
            <div class="name">
                <h2><b class="md">门店</b>恩施荷花村富硒小土豆 5斤</h2>
                &lt;!&ndash;<h1>钻石|白金会员专享</h1>&ndash;&gt;
                <h1 style="color:#666;">市场参考价：60元</h1>
                <h3 style="height:20px;"><em style="font-size:14px;">1000积分</em>&lt;!&ndash;<i>（钻石专享）</i>&ndash;&gt;<b>X1</b></h3>
            </div>
        </div>-->
        <div class="pro" onclick="window.location.href='__MODULE__/Exchange/index/gid/{$goods.id}'">
            <div class="pic"><img src="<?=isMorePic($goods['head_img'])?>"/></div>
            <div class="name">
                <h2><b class="md" <eq name="goods['u_id']" value="0">style="background: #06d1de;"</eq> ><?=$goods['u_id']>0?'门店':'品牌';?></b>{$goods.title} {$goods.u_num}<?=getunit($goods['unit'])?></h2>
                <!--<h1>钻石|白金会员专享</h1>-->
                <h1 style="color:#666;">市场参考价：{$goods.price}元</h1>
                <h3 style="height:20px;"><em style="font-size:14px;">
                    <if condition="$order['total_fee'] gt 0 ">{$order['total_fee']}元</if>
                    <if condition=" $order['card_fee'] gt 0 ">{$order['card_fee']}元</if>
                    <if condition="($order['total_fee'] gt 0 or $order['card_fee'] gt 0) and $order['level_integral'] gt 0">+</if>
                    <if condition="$order['level_integral'] gt 0">{$order['level_integral']}积分</if>
                </em><!--<i>（钻石专享）</i>--><b>X1</b></h3>
            </div>
        </div>
        <div class="total">共<b>1</b>件商品<span>合计：<i>
            <if condition="$order['total_fee'] gt 0 ">{$order['total_fee']}元</if>
            <if condition=" $order['card_fee'] gt 0 ">{$order['card_fee']}元</if>
            <if condition="($order['total_fee'] gt 0 or $order['card_fee'] gt 0) and $order['level_integral'] gt 0">+</if>
            <if condition="$order['level_integral'] gt 0">{$order['level_integral']}积分</if>
        </i></span></div>
        <switch name="order['state']">
            <case value="0">
                <div class="button05"><input type="button"  class="delete del" order_id="{$order.id}" goods_id="{$goods.id}"  value="取消订单" style="background:#fff; border:1px #666666 solid; margin-right:10px; color:#666;"/><input type="button" value="立即付款" onClick="window.location='__MODULE__/Exchange/choosePay/oid/{$order.id}'"/></div>
            </case>
            <case value="2">
                <div class="button05"><input type="button" value="发表评价" onClick="window.location='__MODULE__/UserExchangeorder/evaluate/oid/{$order.id}'"/></div>
            </case>
        </switch>
    </div>
    <div class="ordermess">
        <p>订单编号：{$order.order_sn}</p>
        <p>创建时间：<?=date("Y-m-d H:i:s",$order['addtime']);?></p>
    </div>
    <eq name="order['state']" value="1">
        <div class="code">
            <h2>取货凭证<b>扫码进行核销</b></h2>
            <div class="pic">
                <h3><img src="__PUBLIC__/ExReceive/{$order['qrcode']}"/></h3>
            </div>
        </div>
    </eq>
    <eq name="order['state']" value="3">
        <div class="comment">
            <ul>
                <volist name="evaluate" id ='vo'>
                    <li>
                        <div class="top">
                            <div class="pic"><img src="{$vo.member.avatar}"/></div>
                            <h3>{$vo.member.nickname}</h3><b>{$vo.member.hometown}</b><time><?=date("Y-m-d H:i:s",$vo['addtime'])?></time>
                        </div>
                        <div class="wz">
                            <p>{$vo.content}</p>
                            <p><volist name="vo['pic']" id="pv">
                                <img src="{$pv}"/><!--<img src="__PUBLIC__/Wx/images/pic10.jpg"/><img src="__PUBLIC__/Wx/images/pic11.jpg"/>-->
                            </volist></p>
                        </div>
                        <!--<div class="number"><span>20</span><span style="background:url(__PUBLIC__/Wx/img/comm.png) no-repeat left center; background-size:20px 20px;">2</span></div>-->
                    </li>
                </volist>
            </ul>
        </div>
    </eq>
    <!--<div class="notes">
        <div class="inner">
            <h2><img src="__PUBLIC__/Wx/img/success03.png"/></h2>
            <h3>取消成功！</h3>
        </div>
    </div>-->
</div>
<!--引用悬浮公共导航文件-->
<include file="Public:nav" />
<script type="text/javascript" src="__PUBLIC__/Wx/js/jquery-1.9.1.js"></script>
<script type="text/javascript">
    $(".click span").click(function(){
        if($(this).text() ==="导航"){
            $(this).text("收起");
            $('.link02').css('display','block')
        }else{
            $(this).text("导航");
            $('.link02').css('display','none')
        }//end if
    });//end fun

    //删除订单
    $('.del').click(function(){
        var dele = $(this);
        var order_id = dele.attr('order_id');
        var goods_id = dele.attr('goods_id');
        $.post('<?=U("UserExchangeorder/cancel")?>',{'goods_id':goods_id,'order_id':order_id},function (data) {
            if(!data){
                window.location.href="__MODULE__/UserExchangeorder/index/state/0";
            }else{
                console.log(data);
            }
        })
    });
    /*$(".delete").click(function(){
        $(".notes").css('display','block');
    });*/
    /*$(document).ready(
        function()
        {
            $('.notes').delay(3000).hide(0);
        }
    );*/
</script>
</body>
</html>